<?php if (!defined('THINK_PATH')) exit();?><div class="bjui-pageHeader">
    <div class="pull-right">
        <?php if(I('id') != null): ?><a  onclick="createNavtab('<?php echo U('area',array('id'=>I('preid')));?>','区域管理','area_area')" href="javascript:void(0)" class="btn btn-primary"><i class="fa fa-reply"></i> 返回上一级</a><?php endif; ?>
         <button class="btn-default" data-icon="plus" title="新增导航" data-toggle="tooltip" data-placement="left" onclick="createDialog('<?php echo U("Forms/area");?>', '新增区域', 'area', {width:700,height:450})"></button>
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
    <form id="pagerForm" data-toggle="ajaxsearch" data-loadingmask="true" action="<?php echo U('area');?>" method="post">
        <input type="hidden" name="pageSize" value="<?php echo I('param.pageSize');?>" />
        <input type="hidden" name="pageCurrent" value="<?php echo I('param.pageCurrent');?>" />
        <input type="hidden" name="orderField" value="<?php echo I('param.orderField');?>" />
        <input type="hidden" name="orderDirection" value="<?php echo I('param.orderDirection');?>" />
        <input type="hidden" name="id" value="<?php echo I('id');?>"/>
        <div class="bjui-searchBar">
            <label>区域:</label>
            <input type="text" name="name" value="<?php echo I('name');?>" />
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询 </a>
        </div>
</form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false">
        <thead>
        <tr>
            <th width="60px">序号</th>
            <th>名称</th>
            <th>状态</th>
            <th width="200px">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><?php echo ($vo["id"]); ?></td>
            <td><span class="groys"><?php echo ($vo["name"]); ?></span></td>
            <?php if($vo["status"] == '0'): ?><td><a href="<?php echo U('Forms/update_area_status',array('id'=>$vo['id']));?>" data-type="get" data-toggle="doajax" data-confirm-msg="确定要<strong class='text-danger'>不显示</strong>这个区域?">显示</a></td>
            <?php else: ?>
            <td><a href="<?php echo U('Forms/update_area_status',array('id'=>$vo['id']));?>" data-type="get" data-toggle="doajax" data-confirm-msg="确定要<strong class='text-danger'>显示</strong>这个区域?">不显示</a></td><?php endif; ?>
            <td>
            <?php if($vo["level"] != '3'): ?><button type="button" class="btn-green"  onclick="createNavtab('<?php echo U('area',array('id'=>$vo['id'],'preid'=>$vo['parent_id']));?>','区域管理','area_area')">下级</button><?php endif; ?>
            <button type="button" class="btn-green" onclick="createDialog('<?php echo U("Forms/area",array("id"=>$vo["id"]));?>', '修改区域', 'area', {width:600, height:500})">改</button>
            <a href="<?php echo U('Forms/del_area',array('id'=>$vo['id']));?>" data-type="get" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要<strong class='text-danger'>删除</strong>这个地区吗?">删</a>
            </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
</div>